﻿@model dynamic

@{
	ViewBag.Title = "title";
}
<head>
	<link href="~/Content/bootstrap.css" rel="stylesheet" />
	<script src="~/Scripts/jquery-1.9.1.js"></script>
	<script src="~/Scripts/bootstrap.js"></script>
	<script src="~/Scripts/jquery.signalR-1.0.0.js"></script>
	<script src="~/Scripts/jquery.signalR-1.0.0.min.js"></script>
	<script src="/signalr/hubs"></script>
	<style>
		.test {
			width: 100%
		}
	</style>
</head>

<body>
	
	<script type="text/javascript">
		$(document).ready(function () {
			var test = $.connection.testHub;

			test.hello = function() {
				//when hello-method is called.....
				console.log('hello from hub...');
			};

			$.connection.hub.start().done(function() {
				console.log('hub started.....');
			});

			$('#send').click(function() {
				console.log('clicked');

				$.ajax({
					url: 'http://localhost:56494/Demo/Test'
				}).done(function (data) {
					console.log(data);
					console.log('done....');
				});
			});

			$('#send2').click(function() {
				var th = $.connection.testHub;
				th.hello();
			});

		});

	</script>
	<button class="btn btn-primary" id="send">Send to server</button>
	<button class="btn btn-danger" id="send2">Use hub...</button>
	
</body>

